package com.tuo51.evaluate.domain.evaluatingV2;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.tuo51.foudation.model.Domain;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;

@Data
@Entity
@Table(name = "tb_evaluate_tool")
@EqualsAndHashCode(callSuper = true)
public class EvaluateV2Tool extends Domain{

//    @Column(columnDefinition = "varchar(32) COMMENT '对应测评id'")
//    private String evaluateId;

    public int hashCode(){
        return super.hashCode();
    }

    @Column(columnDefinition = "varchar(50) COMMENT '道具名字' ")
    private String title;

    @Column(columnDefinition = "int default 1 COMMENT '道具數量'")
    private Integer count = 1;

    @Column(columnDefinition = "varchar(50) default '个' COMMENT '道具单位' ")
    private String unit;

    @Column(columnDefinition = "varchar(50) COMMENT '道具备注' ")
    private String comment;

    @Column(columnDefinition = "varchar(255) COMMENT '道具图片'")
    private String imgUrl = "";

    @Column(columnDefinition = "int default 1 COMMENT '道具图片数量'")
    private Integer imgCount = 1;

    @Column(columnDefinition = "varchar(255) COMMENT '推荐购买链接'")
    private String url;

//    @Column(columnDefinition = "varchar(32) COMMENT '问题的id'")
//    private String questionId;

    @ManyToOne
    @JoinColumn(name = "questionId",columnDefinition = "varchar(32) default '' COMMENT '问题的id'")
    @JsonIgnore
    private EvaluateV2Question question;

//    @ManyToOne
//    @JoinColumn(name = "evaluateV2Id",columnDefinition = "varchar(32) default '' COMMENT '测评的id'")
//    @JsonIgnore
//    private EvaluateV2Item item;
}
